<div class="properties-grid">
	<div class="row"><?php foreach ($listings as $listing) { ?> <?php 
		//get media for listing
		$media = $this->mdl_listingmapmodel->get_media($listing['Listing_ID'], "Cover", 1);
		?>
		<div class="property span3">
			<div class="image">
			<div class="content">
				<?php if(isset($media->FileName) && isset($media->FileExtension)) { ?>
				<a href="<?php base_url(); ?>detail/<?php echo $listing['Link']; ?>"><img src="<?php echo $this->config->item('HTTP_LISTING_MEDIA_IMAGE') . $listing['Listing_ID'] . '/' . $media->FileName . '-270x200' . $media->FileExtension; ?>" alt=""></a>
				<?php } else { ?> 
				<img src="<?php echo $this->config->item('HTTP_IMAGE'); ?>tmp/no-image.png" alt=""> 
				<?php } ?>	
			</div>
			<!-- /.content -->
			
			<div class="price"><?php if($listing['Price_Min'] > 0) { ?> <?php echo $listing['PriceUnit'] . " " . number_format(($listing['Price_Min']), 0, '.', ','); ?>
			<?php } else { ?> <?php echo "Price On Application"; ?> <?php } ?></div>
			<!-- /.price --></div>
			<!-- /.image -->
		
			<div class="title">
			<h2><a href="<?php echo base_url(); ?>detail/<?php echo $listing['Link']; ?>"> <?php echo html_entity_decode(character_limiter(ucwords(strtolower($listing['ProjectName'])), 16) , ENT_QUOTES, 'UTF-8'); ?>
			</a></h2>
			</div>
			<!-- /.title -->
			<div class="location">
				<?php if($listing['Price_Min'] > 0) { ?>
				<div class="row-fluid">
					<?php
						$price_usd = $listing['Price_Min'] * IDR_TO_USD;
						$price_usd_formatted = USD_UNIT . " " . number_format(($listing['Price_Min'] * IDR_TO_USD), 0, '.', ',')
					?>
					<div class="pull-left span8 spanusd">
						Estimated <?php echo $price_usd_formatted; ?>
					</div>
					<div class="pull-right span4">
						<select name="curencyid" class="curencyid_ajax span12">
							<option value="AUD">AUD</option>
							<option value="CNY">CNY</option>
							<option value="EUR">EUR</option>
							<option value="GBP">GBP</option>
							<option value="HKD">HKD</option>
							<option value="IDR">IDR</option>
							<option value="INR">INR</option>
							<option value="JPY">JPY</option>
							<option value="NZD">NZD</option>
							<option value="SGD">SGD</option>
							<option value="THB">THB</option>
							<option value="USD" selected="selected">USD</option>
							<option value="VND">VND</option>
						</select>
					</div>
					<span class="price asking_price_local_int" style="visibility: hidden;with:0px;height: 0px;position: absolute">
						<?php echo $listing['PriceUnit'] . " " . number_format(($listing['Price_Min']), 0, '.', ','); ?>
                    </span>
					<span class="price_usd" style="visibility: hidden;with:0px;height: 0px;position: absolute"><?php echo trim($price_usd); ?>
                   	</span>
                   	<span class="unit_price" style="visibility: hidden;with:0px;height: 0px;position: absolute"><?php echo $listing['PriceUnit']; ?></span>
				</div>
				<!-- /.content -->
				<?php } ?>
			</div>
			<!-- /.location -->
			<div class="area"><span class="key">Area:</span><!-- /.key --> <span
				class="value"><?php echo number_format($listing['Size_Min']) . ' ' . $listing['SizeUnit']; ?></span><!-- /.value -->
			</div>
			<!-- /.area -->
			<div class="bedrooms">
			<div class="content"><?php echo $listing['Bedroom']; ?></div>
			</div>
			<!-- /.bedrooms -->
			<div class="bathrooms">
			<div class="content"><?php echo $listing['Bathroom']; ?></div>
			</div>
			<!-- /.bathrooms -->
			<div class="clearfix"></div>
			<div class="morelinks">
				<input type="text" class="btn btn-primary sepH_b contact_agent" value="Contact Agent"> 
				<input type="text" class="btn btn-primary sepH_b view_detail" value="View Details"> 
				<input type="text" class="btn btn-primary sepH_b short_list" value="Short List">
				<input type="hidden" value="<?php echo $listing['Link']; ?>" name="morelinks" id="morelinks">
			</div>
		</div>
		<!-- /.property --> <?php } ?>
	</div>
	<!-- /.row -->
</div>
<!-- /.properties-grid -->
